package com.ecarx.engineermode.tab.Model;

import android.content.Context;

import androidx.appcompat.content.res.AppCompatResources;

import com.ecarx.engineermode.R;
import com.ecarx.engineermode.tab.model.ChildItem;
import com.ecarx.engineermode.tab.model.GroupItem;
import com.ecarx.engineermode.tab.model.TabItem;
import com.ecarx.module_log.LogControlFragment;
import com.ecarx.module_log.LogScreenCaptureFragment;
import com.ecarx.module_network.fragment.NetworkTcamFragment;
import com.ecarx.module_systeminfo.SystemInfoFragment;

import java.util.ArrayList;
import java.util.List;

public class TabModel {

    public static final boolean SOP = true;

    public static List<TabItem> getTabItemList(Context context) {
        List<TabItem> tabItemList = new ArrayList<>();

        tabItemList.add(new TabItem.Builder()
                .setGroupItem(new GroupItem(context.getString(R.string.systeminfo), AppCompatResources.getDrawable(context, R.drawable.ic_systeminfo)
                        , AppCompatResources.getDrawable(context, R.drawable.ic_systeminfo), SystemInfoFragment.class))
                .build());

        return tabItemList;
    }

    public static void addProtectedTabItem(Context context, List<TabItem> tabItemList) {

        tabItemList.add(new TabItem.Builder()
                .setGroupItem(new GroupItem(context.getString(R.string.log), AppCompatResources.getDrawable(context, R.drawable.ic_log)
                        , AppCompatResources.getDrawable(context, R.drawable.ic_log), null))
                .addChildItem(new ChildItem(context.getString(R.string.log_control), LogControlFragment.class))
                .addChildItem(new ChildItem(context.getString(R.string.log_screen_capture), LogScreenCaptureFragment.class))
                .build());

        tabItemList.add(new TabItem.Builder()
                .setGroupItem(new GroupItem(context.getString(R.string.network), AppCompatResources.getDrawable(context, R.drawable.ic_network)
                        , AppCompatResources.getDrawable(context, R.drawable.ic_network), null))
                .addChildItem(new ChildItem(context.getString(R.string.network_tcam), NetworkTcamFragment.class))
                .build());
    }
}
